Class sjl.PriorityQueue
All Packages Class Hierarchy This Package Previous Next Index
Class sjl.PriorityQueue
java.lang.Object
|
+----sjl.PriorityQueue
- public class PriorityQueue
- extends Object
PriorityQueue
is a container adapter where the element
immediatly available for retrival is the largest of those in the sequence.
The container that can be turned into a PriorityQueue
must implement the
BackInsertContainer
interface. Currently Vector
and Deque
can be used as containers for a PriorityQueue
.
Copyright © 1996 Finn Bock
- See Also:
- Vector, Deque
-
PriorityQueue(BackInsertContainer, Predicate2)
- Construct a new PriorityQueue based on the container argument.
-
empty()
- Returns
true
if the queue does not contain any elements.
-
equals(Object)
- Compare the elements in this container with the elements
in another container.
-
pop()
- Removes the top element on the queue.
-
push(Object)
- Insert a new element on the top of the PriorityQueue.
-
size()
- Returns the number of elements stored in the vector.
-
top()
- Returns top element on the queue.
PriorityQueue
public PriorityQueue(BackInsertContainer container,
Predicate2 pred)
- Construct a new PriorityQueue based on the container argument.
equals
public boolean equals(Object container)
- Compare the elements in this container with the elements
in another container.
- Returns:
-
true
is the elements match.
- Overrides:
- equals in class Object
size
public int size()
- Returns the number of elements stored in the vector.
empty
public boolean empty()
- Returns
true
if the queue does not contain any elements.
top
public Object top()
- Returns top element on the queue.
pop
public void pop()
- Removes the top element on the queue.
push
public void push(Object o)
- Insert a new element on the top of the PriorityQueue.
All Packages Class Hierarchy This Package Previous Next Index